<template>
	<div class="right-one">
		<div class="icon" @click="fullScreen"></div>
		<div class="titles">公众号粉丝人数</div>
		<ul class="list-wrap">
			<li class="list" v-for="item in fansNums" :key="item">{{ item }}</li>
		</ul>
	</div>
</template>

<script>
import screenfull from 'screenfull'
import { mapMutations } from 'vuex'
export default {
	name: 'right-one',
	props: {
		fansNums: {
			type: String,
			default: ''
		}
	},
	data() {
		return {
			fullscreen: false
		}
	},
	mounted() {
		window.onresize = () => {
			this.fullscreen = this.checkFull()
    }
	},
	methods: {
		...mapMutations(['mutFullScreen']),
		fullScreen() {
			screenfull.toggle()
		},
		checkFull() {
      console.log(document.body.scrollWidth);
      console.log(window.screen.width);
      return document.body.scrollHeight == window.screen.height && document.body.scrollWidth == window.screen.width
		}
	},
	watch: {
		fullscreen: {
			handler(newVal) {
				console.log(newVal)
				this.mutFullScreen(newVal)
			},
			immediate: true
		}
	}
}
</script>

<style scoped lang="less">
.right-one {
	width: 100%;
	height: 100%;
	position: relative;
	.icon {
		position: absolute;
		right: 0;
		top: 0;
		width: 28px;
		height: 24px;
		background: url('../image/mini.png') no-repeat;
		background-size: 100% 100%;
		float: right;
	}
	.titles {
		font-size: 24px;
		font-weight: 400;
		line-height: 31px;
		color: #ffffff;
		margin-top: 32px;
	}
	.list-wrap {
		display: flex;
		justify-content: flex-start;
		padding-top: 15px;
		box-sizing: border-box;
		.list {
			width: 48px;
			height: 60px;
			text-align: center;
			line-height: 60px;
			border-radius: 6px;
			border: 1px solid #21b5e3;
			box-sizing: border-box;
			margin-right: 12px;
			font-size: 41px;
			color: rgba(255, 255, 255, 1);
		}
	}
}
</style>
